<html>
<head>
    <meta charset="utf-8">
    <title>购物车</title>
    <#assign base=request.contextPath  />
    <#setting  number_format="0.##"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/frame/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/app.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/mui.min.css" media="all">
    <link rel="stylesheet" type="text/css" href="${base}/sweep/css/style.css" />
    <script src="${base}/backstage/js/jquery-1.8.3.min.js"></script>
    <script src="${base}/sweep/js/mui.min.js"></script>
    <script src="${base}/backstage/layui/layui.js"></script>
</head>
<body>
<div class="mui-content">
    <ul class="mui-table-view">
        <#if size!=0>
            <#list good as good>
                <li class="mui-table-view-cell mui-media">
                    <a href="javascript:;">
                        <img class="mui-media-object mui-pull-left" src="${good.goodUrl}">
                        <div class="mui-media-body">
                            ${good.goodName}
                            <p class='mui-ellipsis' style="color: red">
                                ￥${good.goodPrice}
                            </p>
                            <p class='mui-ellipsis' style="color: red" onclick="deleteById('${good.shoppingCarId}')">
                                <button type="button" style="margin-top: 2%;float: right;"><span class="mui-icon mui-icon-trash"></span>删除</button>
                            </p>
                        </div>
                    </a>
                </li>
            </#list>
        </#if>
        <#if size==0>
            <img src="${base}/sweep/images/暂无商品.png" style="width: 100px;height: 100px;position: relative;left:36%">
            <span style="position: relative;top:81px;left: 8%;color: red">空 空 如 也</span>
        </#if>


    </ul>
</div>
</body>
<script>
    layui.use(['form', 'layer', 'upload'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery
            , upload = layui.upload;


    })
    function deleteById(id) {
        $.ajax({
            type: "POST",
            url: "${base}/wx/shoppingCar/cancelShoppingCar",
            data: {id:id} ,
            success: function (data) {
                if(data.code==200){
                    layer.msg(data.msg)
                    setTimeout(function(){
                        window.location.href = "${base}/wx/user/shoppingCar.html";
                        },1000);
                }else{
                    layer.msg(data.msg)
                }
            },
        });
    }
</script>
</html>


